<extend name="Public/base"/>

<block name="body">
    <div class="cf">
		
    </div>
        
        
    <div class="data-table table-striped">
           
            <table class="">
                <thead>
                    <tr >
                       <th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
                        <th>商品名称</th>
                        <th>关联对象类型</th>
                        <th>对象名称</th>                        
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                <notempty name="_list">
                <volist name="_list" id="data">
                    <tr class="pointer even" title="">
                        <td><input class="ids" type="checkbox" name="id[]" value="{$data.id}" /></td>
                        <td><a href="{:U('edit',array('id'=>$data['goods_id']))}">{$data['goods_name']}</a></td>
                        <td>
                        	<switch name="data.type">
                        		<case value="1">
                        			文章
                        		</case>
                        		<case value="2">
                        			
                        		</case>
                        	</switch>
                        </td>
                        <td><a href="{:U('Article/edit',array('id'=>$data['object_id']))}">{$data['object_name']}</a></td>
                        <td><a class="ajax-get confirm" href="{:U('Goods/delRelation',array('id'=>$data['id']))}">删除</a></td>
                       
                    </tr>
                </volist>
                <else/>
				<td colspan="5" class="text-center"> aOh! 暂时还没有内容! </td>
				</notempty>
                </tbody>
            </table></div>
    <div class="page">
        {$_page}
    </div>
    
    <script type="text/javascript">
    
    $(function(){
       
      //搜索功能
    	$("#search").click(function(){
    		var url = $(this).attr('url');
            var query  = $('.search-form').serialize();
            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
            query = query.replace(/^&/g,'');
            if( url.indexOf('?')>0 ){
                url += '&' + query;
            }else{
                url += '?' + query;
            }
    		window.location.href = url;
    	});
    	highlight_subnav("{:U('Goods/relation')}");
    });

</script>
</block>
     

